package ncut.shumei.service.impl;

import ncut.shumei.dao.BookDao;
import ncut.shumei.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

@Service("bookServiceAnnotation")
public class BookServiceImplAnnotation implements BookService {
    
    private BookDao bookDao;
    
    @Autowired
    @Qualifier("bookDaoAnnotation")
    public void setBookDao(BookDao bookDao) {
        this.bookDao = bookDao;
    }

    @Override
    public void saveBook() {
        System.out.println("使用注解注入 - 保存图书信息");
        bookDao.saveBook();
    }

    @Override
    public void updateBook() {
        System.out.println("使用注解注入 - 更新图书信息");
        bookDao.updateBook();
    }

    @Override
    public void queryBook() {
        System.out.println("使用注解注入 - 查询图书信息");
        bookDao.queryBook();
    }

    @Override
    public void deleteBook() {
        System.out.println("使用注解注入 - 删除图书信息");
        bookDao.deleteBook();
    }
} 